<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='老人档案',cssPaths='/static/css/elder/elderly/info.css',jsPaths='/static/js/elder/elderly/info.js,/static/plugins/jquery-migrate-1.2.1.min.js,/static/plugins/jquery.jqprint-0.3.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
        <span class="layui-breadcrumb" lay-separator=">">
            <a th:href="@{/}">首页</a>
              <a href="/gbElderly/elist">老人管理</a>
                <a href="/elderly">老人档案</a>
                <a><cite>查看</cite></a>
        </span>
    </div>

    <!--主体内容区-->
    <div class="form-content">
        <div class="layui-card">
            <div class="layui-card-header">老人信息 <a  style="color: #01AAED;margin-left: 20px;font-weight: normal;" th:href="@{/elderly/edit(id=${elderly.id})}">修改</a> <a style="color: #01AAED;margin-left: 20px;font-weight: normal;" href="javascript:void(0)" id="dy">打印</a>
            <a style="color: #01AAED;margin-left: 20px;font-weight: normal;" th:href="@{/elderly/export/pdf(elderlyId=${elderly.id})}">导出PDF</a></div>
            <div class="layui-card-body">

                <table id="lrdn" cellpadding="0">
                    <tr>
                        <td style="width: 120px;">姓名</td>
                        <td style="width: 200px;">
                            <span th:text="${elderly.name}"></span>
                        </td>
                        <td style="width: 120px;">院内编号</td>
                        <td style="width: 200px;">
                            <span th:text="${elderly.code}"></span>
                        </td>
                        <td rowspan="3" style="width: 151px;">
                                <img th:if="${elderly.avatar == null}" src="/static/imgs/txsc.png" alt="头像" id="avatarimg" style="cursor: pointer;">
                                <img th:if="${elderly.avatar != null}" th:src="@{'/storage/files/' + ${elderly.avatar}}" alt="头像" id="avatarimg" style="cursor: pointer;">
                        </td>
                    </tr>
                    <tr>
                        <td >出生日期</td>
                        <td>
                            <span th:text="${#dates.format(elderly.birthday,'yyyy-MM-dd')}"></span>
                        </td>

                        <td>性别</td>
                        <td>
                            <span th:text="${elderly.sex}"></span>
                        </td>
                    </tr>
                    <tr>
                        <td>供养人性质</td>
                        <td>
                            <span th:if="${elderly.elderlyNature eq 1}" th:text="社会老人"></span>
                            <span th:if="${elderly.elderlyNature eq 2}" th:text="三无老人"></span>
                            <span th:if="${elderly.elderlyNature eq 3}" th:text="五保老人"></span>
                            <span th:if="${elderly.elderlyNature eq 4}" th:text="特困老人"></span>
                        </td>

                        <td>民族</td>
                        <td>
                            <span th:text="${elderly.nation}"></span>
                        </td>
                    </tr>
                    <tr>
                        <td >优抚对象</td>
                        <td>
                            <span th:text="${elderly.youfu ?'是' : '否'}"></span>
                        </td>
                        <td>身份证号</td>
                        <td colspan="2">
                            <span th:text="${elderly.idNo}"></span>
                        </td>
                    </tr>
                    <tr>
                        <td>空巢老人</td>
                        <td>
                            <span th:text="${elderly.emptyNest ?'是' : '否'}"></span>
                        </td>
                        <td>联系电话</td>
                        <td colspan="2">
                            <span th:text="${elderly.phone}"></span>
                        </td>
                    </tr>

                    <tr>
                        <td >健康状况</td>
                        <td >
                            <span th:if="${elderly.healthCondition eq 1}" th:text="自理老人"></span>
                            <span th:if="${elderly.healthCondition eq 2}" th:text="半失能老人"></span>
                            <span th:if="${elderly.healthCondition eq 3}" th:text="失能老人"></span>
                            <span th:if="${elderly.healthCondition eq 4}" th:text="精神病人"></span>
                        </td>
                        <td>评估结果</td>
                        <td colspan="2">
                            <span th:text="${elderly.pgjg}"></span>
                        </td>
                    </tr>
                    <tr>


                        <td>现住址</td>
                        <td colspan="4">
                            <span th:text="${elderly.provinceName}"></span>
                            <span th:text="${elderly.cityName}"></span>
                            <span th:text="${elderly.areaName}"></span>
                            <span th:text="${elderly.townName}"></span>
                            <span th:text="${elderly.address}"></span>
                        </td>
                    </tr>
                    <tr>
                        <td>联系人</td>
                        <td colspan="2">联系电话</td>
                        <td  colspan="2">关系</td>
                    </tr>
                    <tr>
                        <td><span th:text="${folks[0].name}"></span></td>
                        <td  colspan="2"><span th:text="${folks[0].phone}"></span></td>
                        <td colspan="2">
                            <span th:if="${folks[0].relation eq 1}" th:text="配偶"></span>
                            <span th:if="${folks[0].relation eq 2}" th:text="子女"></span>
                            <span th:if="${folks[0].relation eq 3}" th:text="兄弟"></span>
                            <span th:if="${folks[0].relation eq 4}" th:text="其他"></span>
                        </td>
                    </tr>
                    <tr>
                        <td><span th:text="${folks[1].name}"></span></td>
                        <td colspan="2"><span th:text="${folks[1].phone}"></span></td>
                        <td colspan="2">
                            <span th:if="${folks[1].relation eq 1}" th:text="配偶"></span>
                            <span th:if="${folks[1].relation eq 2}" th:text="子女"></span>
                            <span th:if="${folks[1].relation eq 3}" th:text="兄弟"></span>
                            <span th:if="${folks[1].relation eq 4}" th:text="其他"></span>
                        </td>
                    </tr>

                </table>
            </div>
        </div>
    </div>

    <div class="form-content" >
        <div class="layui-card">
            <div class="layui-card-header">健康数据(各数值取自最新体检数据)</div>
            <div class="layui-card-body">
                <div style="width: 900px;">
                    <span th:if="${#lists.size(healthDataList) <= 0 }" style="color: #CCCCCC;">暂无健康数据</span>
                    <table class="layui-table" lay-size="sm" th:if="${#lists.size(healthDataList) > 0 }">
                        <thead>
                            <tr>
                                <th>名称</th>
                                <th>数据</th>
                                <th>状况</th>
                                <th>详情与建议</th>
                                <th>参考数值</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr th:each="hd:${healthDataList}">
                                <td th:text="${hd.healthDataitemName}" style="color: orangered;"></td>
                                <td th:text="${hd.value}"></td>
                                <td th:if="${!hd.nature}" th:text="阴性"></td>
                                <td th:if="${hd.nature}" th:text="阳性" style="color: red;font-size: 1.1em;"></td>
                                <td th:text="${hd.description} ?: '无'"></td>
                                <td th:text="${hd.standardValues} ?: '无'"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="form-content">
        <div class="layui-card">
            <div class="layui-card-header">服务记录</div>
            <div class="layui-card-body">
                <div style="width: 900px;">
                    <span th:if="${#lists.size(records) <= 0 }" style="color: #CCCCCC;">暂无服务记录</span>
                    <table class="layui-table" lay-size="sm"  th:if="${#lists.size(records) > 0 }">
                        <thead>
                        <tr>
                            <th>项目名称</th>
                            <th>项目分类</th>
                            <th>费用</th>
                            <th>服务时间</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="r:${records}">
                            <td th:text="${r.itemName}"></td>
                            <td th:text="${r.serverTypeName}"></td>
                            <td th:text="${r.cost}"></td>
                            <td th:text="${#dates.format(r.serviceDate,'yyyy-MM-dd')}"></td>
                            <td th:text="${r.remark}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</html>